package submarine;

import javax.swing.ImageIcon;

/**
 * 战舰
 */
public class Battleship extends SeaObject {
    private int life;

    public Battleship(){
        super(66, 26, 270, 124, 20);
        life = 5;
    }

    public void move(){}

    public void moveLeft(){
        x -= speed;
    }

    public void moveRight(){
        x += speed;
    }

    public ImageIcon getImage() {
        return Images.battleship;
    }

    public Bomb shootBomb(){
        return new Bomb(x, y);
    }

    public boolean isOutOfBounds(){
        return x >= World.WIDTH;
    }

    public void addLife(int num) {
        life += num;
    }

    public int getLife() {
        return life;
    }

    public void subtractLife() {
        life--;
    }

}
